package chapter23.homework02;

public class Final extends State {
    public Final(State pro){
        this.rankName = "元老级";
        this.player = pro.player;
        this.point = pro.point;

    }

    @Override
    public void peekCard() {
        System.out.println(rankName + "玩家" + player.getName() + "偷看他人手牌的功能");
    }

    @Override
    public void changeCards() {
        System.out.println(rankName + "玩家" + player.getName() + "换牌的功能");
    }

    @Override
    public void doubleScore() {
        System.out.println(rankName + "玩家" + player.getName() + "使用积分+30");
        point += 30;
        checkState(point);
    }

    @Override
    public void checkState(int point) {
        if(point < 150){
            player.setState(new Pro(this));
        }
    }
}
